using System;
using System.IO;
using System.Xml;
using System.Xml.Serialization;
using System.Collections.Generic;
using System.Collections;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;
using SumGam.Globals;
using SumGam.Structs;
using SumGam.Classes;

namespace SumGam
{
    public class BaseEntity
    {
        public int Slot;
        public bool Visible, Initialized, ShouldRemove, Physical, Static, Trigger, MovingPlatform, NotSolid;
        public Vector2 Position, Velocity;
        public Vector2 Origin;
        public float Width, Height;
        public AnimatedTexture Sprite;
        public BaseEntity()
        {
        }
        public virtual void Initialize()
        {
        }
        public virtual void Think()
        {
            //Texture.UpdateFrame((float)Misc.Time.ElapsedGameTime.TotalSeconds);
        }
        public virtual void Draw()
        {
            //Texture.DrawFrame(Rendering.spriteBatch, Position);
        }
        public virtual void DoPhysics()
        {
        }
        public virtual void HandleCollision(BaseEntity Entity)
        {
        }
        public virtual void OnRemove()
        {
        }
        public void Remove()
        {
            ShouldRemove = true;
            OnRemove();
        }
        public bool IsValid()
        {
            return (this.GetType() != typeof(BaseEntity));
        }
        public float GetRadius()
        {
            return Vector2.Distance(Vector2.Zero, new Vector2(Width, Height)) / 2;
        }
        public Rectangle GetBoundingRectangle()
        {
            return new Rectangle((int)(Position.X - Origin.X), (int)(Position.Y - Origin.Y), (int)Width, (int)Height);
        }
    }
}